<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     base_default
 */

/**
 * @see Mage_Centinel_Block_Authentication
 * @var Mage_Centinel_Block_Authentication $this
 */
?>
<?php if ($this->getAuthenticationStart()):?>
    <div class="centinel" id="centinel_authenticate_block">
        <h3><?php echo $this->__('Card Verification')?></h3>
        <p><?php echo $this->__('Please verify the card with the issuer bank:') ?></p>
        <div class="authentication">
            <iframe id="centinel_authenticate_iframe" frameborder="0" border="0" src=""></iframe>
        </div>
    </div>
    <script type="text/javascript">
    //<![CDATA[
        CentinelAuthenticateController = new CentinelAuthenticate('centinel_authenticate_block', 'centinel_authenticate_iframe');
        <?php foreach ($this->getRelatedBlocks() as $relatedBlockId):?>
            CentinelAuthenticateController.addRelatedBlock('<?php echo $relatedBlockId ?>');
        <?php endforeach ?>
        <?php if ($this->getAuthenticationStartMode() == 'instant'): ?>
            CentinelAuthenticateController.start('<?php echo $this->getFrameUrl() ?>');
        <?php elseif ($this->getAuthenticationStartMode() == 'window'):?>
            Event.observe(window, 'load', function(){CentinelAuthenticateController.start('<?php echo $this->getFrameUrl() ?>');});
        <?php endif ?>
    //]]>
    </script>
<?php else: ?>
    <script type="text/javascript">
    //<![CDATA[
        if (typeof CentinelAuthenticateController != 'undefined') {
            CentinelAuthenticateController.cancel();
        }
    //]]>
    </script>
<?php endif ?>
